<div id="correct_container" style="margin:0px auto; width:1000px; margin-bottom:10px; font-size:14px"><!--
--><div style="display:inline-block;">掌握情况：</div><!--
--><div style="display:inline-block;">
  全部<input type="checkbox" value="<?php echo $correct?>" style=""  /> 
  准备<input type="checkbox" value="0" style=""  /> 
  破冰<input type="checkbox" value="1-15" style="" /> 
  毕业<input type="checkbox" value="16-" style="" checked="checked"/> 
  </div><!--
--></div>
<script language="javascript">
function getCorrectParam(){
	
	var checkboxs = $('#correct_container').find('input');
	//console.log(checkboxs.length);
	
	for(var i=0; i<checkboxs.length; i++){
		//console.log(checkboxs[i].value);	
		//console.log($(checkboxs[i]).is(':checked'));	
	}
	
	if($(checkboxs[0]).is(':checked')){
		return "all";	
	}
	
	if($(checkboxs[1]).is(':checked') && $(checkboxs[2]).is(':checked') && $(checkboxs[3]).is(':checked')){
		return "all";	
	}
	
	if(!$(checkboxs[1]).is(':checked') && !$(checkboxs[2]).is(':checked') && !$(checkboxs[3]).is(':checked')){
		return "none";	
	}

	if($(checkboxs[1]).is(':checked') && $(checkboxs[2]).is(':checked') && !$(checkboxs[3]).is(':checked')){
		return "0-15";	
	}
	
	if(!$(checkboxs[1]).is(':checked') && $(checkboxs[2]).is(':checked') && $(checkboxs[3]).is(':checked')){
		return "1-";	
	}
	
	if($(checkboxs[1]).is(':checked') && !$(checkboxs[2]).is(':checked') && $(checkboxs[3]).is(':checked')){
		return "0,16-";	
	}
	
	if($(checkboxs[1]).is(':checked') && !$(checkboxs[2]).is(':checked') && !$(checkboxs[3]).is(':checked')){
		return "0";	
	}
	
	if(!$(checkboxs[1]).is(':checked') && $(checkboxs[2]).is(':checked') && !$(checkboxs[3]).is(':checked')){
		return "1-15";	
	}
	
	if(!$(checkboxs[1]).is(':checked') && !$(checkboxs[2]).is(':checked') && $(checkboxs[3]).is(':checked')){
		return "16-";	
	}
}

(function(){
//	console.log(getCorrectParam());
	var checkboxs = $('#correct_container').find('input');
	for(var i=0; i<checkboxs.length; i++){
		//console.log(checkboxs[i].value);	
		//console.log($(checkboxs[i]).is(':checked'));	
	}
	
	var correct = checkboxs[0].value;

	if(correct == "all"){
		$(checkboxs[0]).attr("checked", true);
		$(checkboxs[1]).attr("checked", true);
		$(checkboxs[2]).attr("checked", true);
		$(checkboxs[3]).attr("checked", true);
	}else if(correct == "none"){
		$(checkboxs[1]).attr("checked", false);
		$(checkboxs[2]).attr("checked", false);
		$(checkboxs[3]).attr("checked", false);
	}else if(correct == "0-15"){
		$(checkboxs[1]).attr("checked", true);
		$(checkboxs[2]).attr("checked", true);
		$(checkboxs[3]).attr("checked", false);
	}else if(correct == "1-"){
		$(checkboxs[1]).attr("checked", false);
		$(checkboxs[2]).attr("checked", true);
		$(checkboxs[3]).attr("checked", true);
	}else if(correct == "0,16-"){
		$(checkboxs[1]).attr("checked", true);
		$(checkboxs[2]).attr("checked", false);
		$(checkboxs[3]).attr("checked", true);
	}else if(correct == "0"){
		$(checkboxs[1]).attr("checked", true);
		$(checkboxs[2]).attr("checked", false);
		$(checkboxs[3]).attr("checked", false);
	}else if(correct == "1-15"){
		$(checkboxs[1]).attr("checked", false);
		$(checkboxs[2]).attr("checked", true);
		$(checkboxs[3]).attr("checked", false);
	}else if(correct == "16-"){
		$(checkboxs[1]).attr("checked", false);
		$(checkboxs[2]).attr("checked", false);
		$(checkboxs[3]).attr("checked", true);
	}else{
		$(checkboxs[1]).attr("checked", true);
		$(checkboxs[2]).attr("checked", true);
		$(checkboxs[3]).attr("checked", false);	
	}
	
})();

</script>
